package com.rz.htk.product.controller;

import com.rz.core.kit.RespKit;
import com.rz.core.resp.ResultResp;
import com.rz.htk.product.entity.ProductDiscount;
import com.rz.htk.product.entity.ProductPrice;
import com.rz.htk.product.entity.vo.PrdDeleteParam;
import com.rz.htk.product.entity.vo.PrdDiscountParam;
import com.rz.htk.product.entity.vo.PrdPriceParam;
import com.rz.htk.product.service.IProductDiscountService;
import com.rz.htk.product.service.IProductPriceService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName ProductDiscountController
 * @Description 产品资费折扣信息
 * @Author maweiyue
 * @Date 2019/5/13 19:20
 */
@RestController
@RequestMapping("discount")
public class ProductDiscountController {

    @Resource
    private IProductDiscountService productDiscountService;

    @PostMapping("/listDiscount/{prdCode}/{mngId}")
    public ResultResp getPage(@PathVariable String prdCode, @PathVariable Integer mngId){
        return RespKit.success(this.productDiscountService.listProductDiscount(prdCode, mngId));
    }

    @PostMapping("/saveOrUpdate")
    public ResultResp saveOrUpdate(@RequestBody PrdDiscountParam param){
        return RespKit.success(this.productDiscountService.saveOrUpdateDiscount(param));
    }
}
